//
//  SWProjectCell.m
//  YiYueHairdresser
//
//  Created by Sky on 2018/10/29.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "SWProjectCell.h"

@implementation SWProjectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    UIView *mainView = [[UIView alloc]initWithFrame:CGRectMake(0, 5, 25, 20)];
    UIImageView *iconView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 5, 10, 10)];
    iconView.contentMode = UIViewContentModeScaleAspectFit;
    iconView.image = [UIImage imageNamed:@"down"];
    [mainView addSubview:iconView];
    self.selectTextField.rightView = mainView;
    self.selectTextField.rightViewMode = UITextFieldViewModeAlways;
    self.iconImageView = iconView;
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
- (IBAction)selectAction:(UIButton *)sender {
    self.block(self, sender.tag);
}



-(void)setProjectCellData:(STServiceOptionModel*)model withArrServices:(NSArray*)services{
    for (STServiceCategoryModel * serviceModel in services) {
        if ( model.categoryId == serviceModel.objectId) {
            if(serviceModel.options.count){
                self.titleBLab.hidden = NO;
                self.inputField.hidden = NO;
                self.titleBLab.text = model.optionname;
                STServiceOOModel * oomodel =model.pakageOptionDetails.firstObject;
                self.inputField.text = oomodel.optionvalue ;
            }else{
                self.titleBLab.hidden = YES;
                self.inputField.hidden = YES;
            }
            self.selectTextField.text =serviceModel.name;
        }
    }
}


@end
